import request from '@/router/axios';

export const getList = (current, size,offerId, params) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/page',
    method: 'get',
    params: {
      ...params,
      offerId,
      current,
      size,
    }
  })
}

export const exportExcel = (offerId, params, ids) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/export',
    method: 'get',
    responseType: 'blob',
    params: {
      ...params,
      ids,
      offerId
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/submit',
    method: 'post',
    data: row
  })
}

//获取审核清单
export const submitAudit = (data) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/submit-audit',
    method: 'post',
    data: data
  })
}

//查看审核清单
export const viewCreative = (id) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/view-creative',
    method: 'get',
    params: {
      id
    }
  })
}

//复制链接
export const copyLink = (auditId, opType = '') => {
  return request({
    url: '/api/beetles-offer/creativeaudit/get-audit-link',
    method: 'get',
    params: {
      auditId,
      opType,
    }
  })
}

//初始化新增审核素材
export const examintCreative = (current, size, params) => {
  return request({
    url: '/api/beetles-offer/creative/select-audit-creative',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

//添加新增审核素材
export const addCreativeInfo = (data) => {
  // creativeIds
  return request({
    url: '/api/beetles-offer/creativeaudit/get-creatives-info',
    method: 'post',
    data: data
  })
}

//编辑提交
export const updataSubmit = (data) =>{
  return request({
    url:'/api/beetles-offer/creativeaudit/update',
    method:'post',
    data:data
  })
}

export const examineView = (data) =>{
  return request({
    url:'/api/beetles-offer/creativeaudit/submit-audit',
    method:'post',
    data:data
  })
}

//审核页面
export const examineMain = (data) =>{
  return request({
    url:'/api/beetles-offer/creativeaudit/audit-all-creative',
    method:'post',
    data:data,
  })
}

//提交审核页面
export const examineSubmit = (data) =>{
  return request({
    url:'/api/beetles-offer/creativeaudit/submit',
    method:'post',
    data:data,
  })
}

//更新素材审核状态
export const updateStatus = (offerId) =>{
  return request({
    url: '/api/beetles-offer/creativeaudit/get-expired',
    method: 'get',
    params: {
      offerId
    }
  })
}
export const updateCreativeStatus = () =>{
  return request({
    url: '/api/beetles-offer/creativeaudit/updata-creative-status',
    method: 'get',
  })
}

export const releaseAuditCreative = (id) => {
  return request({
    url: '/api/beetles-offer/creativeaudit/release-creative',
    method: 'get',
    params: {
      id
    }
  })
}

export const rollbackCreativeAudit = (ids) =>{
  return request({
    url: '/api/beetles-offer/creativeaudit/rollback-creative-audit',
    method: 'get',
    params: {
      ids
    }
  })
}

//检查链接+审核码
export const outExamineKey = (data) =>{
  return request({
    url:'/api/beetles-offer/public/creativeaudit/view-creative-with-key',
    method:'post',
    data:data,
  })
}

export const outExamineMain = (data) =>{
  return request({
    url:'/api/beetles-offer/public/creativeaudit/audit-all-creative',
    method:'post',
    data:data,
  })
}

//获取设计师名单
export const outGetDesigner = (key) =>{
  return request({
    url: '/api/beetles-offer/public/creativeaudit/get-designer-select',
    method: 'get',
    params: {
      key
    }
  })
}

//提交审核页面
export const outExamineSubmit = (data) =>{
  return request({
    url:'/api/beetles-offer/public/creativeaudit/submit',
    method:'post',
    data:data,
  })
}

